//Auto_Band (600W) 09/07/2019 #define A 10 #define B 9 #define C 8 #define KeyOut 7 #define In80 2 #define In40 3 #define In20 4 #define InHI 5 #define KeyIn 6 #define Pulse 12 int filter80; int filter40; int filter20; int filterHI; int key = LOW; void setup() { // put your setup code here, to run once: pinMode(A, OUTPUT); pinMode(B, OUTPUT); pinMode(C, OUTPUT); pinMode(KeyOut, OUTPUT); pinMode(In80, INPUT_PULLUP); pinMode(In40, INPUT_PULLUP); pinMode(In20, INPUT_PULLUP); pinMode(InHI, INPUT_PULLUP); pinMode(KeyIn, INPUT_PULLUP); } void loop() { filter80 = digitalRead(In80); filter40 = digitalRead(In40); filter20 = digitalRead(In20); filterHI = digitalRead (InHI); key = digitalRead (KeyIn); if (filter80 == LOW) {Band80();} //80m filter else if (filter40 == LOW) {Band30_40();} //40m filter else if (filter20 == LOW) {Band20();} //20m filter else if (filterHI == LOW) {Band17_15_12_10();} //17m,15m,12m,10m filter key = !key; digitalWrite(KeyOut, key); } //D5 = Amp connector pin 2; D4 = connector pin 4; D3 = connector pin 8; D2 = connector pin 1 void Band17_15_12_10() { digitalWrite(A, HIGH); digitalWrite(B, HIGH); digitalWrite(C, HIGH); } void Band20() { digitalWrite(A, LOW); digitalWrite(B, HIGH); digitalWrite(C, HIGH); } void Band30_40() { digitalWrite(A, LOW); digitalWrite(B, LOW); digitalWrite(C, HIGH); } void Band80() { digitalWrite(A, LOW); digitalWrite(B, HIGH); digitalWrite(C, LOW); }